Make GtkHandleBox size request code use GtkStyleContext for padding
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 4 Jan 2011 01:35:19 +0000 (02:35 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 4 Jan 2011 02:06:22 +0000 (03:06 +0100)
gtk/gtkhandlebox.c

index bb5249209b7d31b7f583b017d5b4064edb8f14ac..c96f66579df64f1f8c0cd5f1c3df60be2a1ed52b 100644 (file)
@@ -611,11 +611,19 @@ gtk_handle_box_size_request (GtkWidget      *widget,
        }
       else
        {
+          GtkStyleContext *context;
+          GtkStateFlags state;
+          GtkBorder padding;
+
+          context = gtk_widget_get_style_context (widget);
+          state = gtk_widget_get_state_flags (widget);
+          gtk_style_context_get_padding (context, state, &padding);
+
          if (handle_position == GTK_POS_LEFT ||
              handle_position == GTK_POS_RIGHT)
-           requisition->height += gtk_widget_get_style (widget)->ythickness;
+           requisition->height += padding.top;
          else
-           requisition->width += gtk_widget_get_style (widget)->xthickness;
+           requisition->width += padding.left;
        }
     }
   else